<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
{eval $user=$this->user; $setting=$this->setting;}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tipask's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset={APP_CHARSET}">
<link media="all" type="text/css" href="css/admin/admincp.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jqueryui.js"></script>
<script src="js/admin.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#list").sortable({
		update: function(){
			var reorderid="";
			var numValue=$("input[name='order[]']");
			for(var i=0;i<numValue.length;i++){
				reorderid+=$(numValue[i]).val()+",";
			}
			var hiddencid=$("input[name='hiddencid']").val();
			$.post("index.php?c=admin_category&a=reorder",{order:reorderid,hiddencid:hiddencid});
		}
	});
});
</script>
</head>
<body>
<div id="append">
</div>
<div class="container">
	<!--{if isset($message)}-->
		<!--{eval $type=isset($type)?$type:'correctmsg'; }-->
		<div class="{$type}"><p>{$message}</p></div>
	<!--{/if}-->
	<h3 class="marginbot">分类列表<a class="sgbtn" href="index.php?c=admin_category&a=add/new">添加新分类</a></h3>
		<div id="path"><a href="index.php?c=admin_category&a=default">根目录</a>
		{if isset($navlist)}
			<!--{loop $navlist $nav}-->
				 &gt;&gt; <a href="index.php?c=admin_category&a=view/$nav['id']">{$nav['name']}</a>  
			 <!--{/loop}-->
		{/if}
			 {if isset($category['name'])}&gt;&gt; {$category['name']}{/if}
		</div>
		<div class="note fixwidthdec">
		<p class="i">分类的排序可以通过鼠标拖动来改变，当鼠标在某一分类上面时，按住左键即可上下移动。</p>
		</div>
	<div class="mainbox">
			<form name="answerlist" onsubmit="return confirm('删除该分类会同时删除该分类下的子分类及其分类下的所有问题，确定继续?');" action="index.php?c=admin_category&a=remove" method="post">
			<table width="80%" cellspacing="0" cellpadding="3" class="list">
				<tr align="center" class="list_title">
					<th width="15%" align="left"><input class="checkbox" id="chkall" onclick="checkall('cid[]')" type="checkbox" name="chkall"><label for="chkall">全选</label></th>					
					<th width="30%" align="center"><strong>分类名称</strong></th>
					{if  2>$category['grade']}
						<th  width="20%" align="center"><strong>查看子分类</strong></th>
						<th  width="20%" align="center"><strong>添加子分类</strong></th>
					{/if}
					<th  width="15%" align="center"><strong>编辑</strong></th>
				</tr>    
			</table>
			    <input type="hidden" name="hiddencid" value="{$pid}" />
				<ul id="list" style="cursor: hand; cursor: pointer;" >
					{loop $categorylist $cate}
					<li style="list-style:none;">
						<table width="80%"  class="list" id="table1">
							<tr style="background:#f7f7f7">
								<td width="15%"><input class="checkbox" type="checkbox" value="{$cate['id']}" name="cid[]"></td>
								<td width="30%" ><a href="index.php?c=admin_category&a=view/$cate['id']"><input name="order[]" type="hidden" value="{$cate['id']}"/><strong>{$cate['name']}</strong></a></td>
								{if  2>$category['grade']}
								<td width="20%" align="center"><a href="index.php?c=admin_category&a=view/$cate['id']"><img src="css/admin/view.png"></a></td>
								<td width="20%" align="center"><a href="index.php?c=admin_category&a=add/$cate['id']/$cate['pid']"><img src="css/admin/add.png"></a></td>
								{/if}
								<td width="15%" align="center"><a href="index.php?c=admin_category&a=edit/$cate['id']"><img src="css/admin/edit.png"></a></td>
							</tr>
						</table>
					</li>
					{/loop}
				</ul>
				<table width="80%" cellspacing="0" cellpadding="3">
				<tr class="nobg"><td><input class="btn" type="submit" name="submit" value="删&nbsp;除" /></td></tr>
				</table>
			</form>
	</div>
</div>
</body>
</html>